// base ent manager

// Map quake_yard
Quakeitem = {}
Quakeitem[1] = {	classname =	"weapon_railgun", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-1640.570313,938.805420,3387.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "weapon"
				}
Quakeitem[2] = {	classname =	"weapon_railgun", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-1718.719727 ,2165.856201, 3286.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "ammo"
				}
Quakeitem[3] = {	classname =	"weapon_railgun", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-1539.006592, 2151.865479, 3286.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "ammo"
				}
Quakeitem[4] = {	classname =	"weapon_rocketluncher", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-2058.461670 ,2779.044189 ,3497.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "weapon"
				}
Quakeitem[5] = {	classname =	"weapon_rocketluncher", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-1214.938965, 2784.521973, 3497.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "weapon"
				}
Quakeitem[6] = {	classname =	"weapon_rocketluncher", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-2051.022217 ,2716.922119 ,3497.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "ammo"
				}
Quakeitem[7] = {	classname =	"weapon_rocketluncher", 
					nicename  =	"Machinegun",
					angle     =	Angle(0,0,0),
					vector	  =	Vector(-1218.684814, 2702.071533, 3497.031250),
					model	  =	"models/weapons/w_smg1.mdl",
					ammo	  =	"10" ,
					ammotype  = "Pistol",
					ammot	  = "ammo"
				}


MapItem = {}
MapItem[1] =  {		
					angle     =	Angle(0,0, 0),
					vector	  =	Vector(-1629, 3059, 3363.5),
					color	  = Color(0,0,0,255),
					model	  = "models/props_phx/construct/metal_plate2x2.mdl"
				}
MapItem[2] =  {		
					angle     =	Angle(-320, 90, 0),
					vector	  =	Vector(-1629, 3141.62, 3332.52),
					color	  = Color(255,0,0,255),
					model	  = "models/props_phx/construct/metal_plate2x2.mdl"
				}
MapItem[3] =  {		
					angle     =	Angle(-322, 360, 0),
					vector	  =	Vector(-1548, 3060, 3334),
					color	  = Color(0,255,0,255),
					model	  = "models/props_phx/construct/metal_plate2x2.mdl"
				}
MapItem[4] =  {		
					angle     =	Angle(-320, 270, 0),
					vector	  =	Vector(-1629, 2980, 3334),
					color	  = Color(0,0,255,255),
					model	  = "models/props_phx/construct/metal_plate2x2.mdl"
				}
MapItem[5] =  {	
					angle     =	Angle(-320, 180, 0),
					vector	  =	Vector(-1710, 3060, 3334),
					color	  = Color(0,255,255,255),
					model	  = "models/props_phx/construct/metal_plate2x2.mdl"
				}
MapItem[6] =  {	
					angle     =	Angle(0, 0, 0),
					vector	  =	Vector(-1063, 3132, 3504),
					color	  = Color(0,255,255,255),
					model	  = "models/props_phx/construct/metal_angle360.mdl"
				}
MapItem[7] =  {	
					angle     =	Angle(0, 0, 0),
					vector	  =	Vector(-2200, 3159.5, 3505.5),
					color	  = Color(0,255,255,255),
					model	  = "models/props_phx/construct/metal_angle360.mdl"
				}
// Settyp
	-- local ent = ents.Create( "quake_pickup" )
		-- ent:Settyp("ammo")
		-- ent:SetPos( SpawnPos )
		-- ent:Spawn()
		-- ent:Activate()


function GM:IsQuakeMap( map )

local maptype = string.Explode( "_", map )

if(maptype[1] == "quake") then
	return true
else 
	return false
end

end


function GM:AddItem()

if(!self:IsQuakeMap(game.GetMap())) then  Msg("no quake map") return end

for a = 1, #MapItem do

		local ent = ents.Create( "map_jumppad" )
		 ent:SetModel(MapItem[a].model)
		 ent:SetPos( MapItem[a].vector )
		 ent:SetAngles(MapItem[a].angle)
		 ent:SetColor(MapItem[a].color)
		 ent:Spawn()
		 //ent:Activate()
		end
for i = 1, #Quakeitem do
		 local ent = ents.Create( "quake_pickup" )
		 ent:Settyp(Quakeitem[i].ammot)
		 ent:SetPos( Quakeitem[i].vector )
		 ent:Spawn()
		 ent:Activate()
		 Msg("spawned"..(Quakeitem[i].classname).."\n")
end

end

function GM:InitPostEntity( )	

self:AddItem()

end